<?php

namespace App\Http\Controllers\Api;

use App\Banner;
use App\Distribution;
use App\Http\Services\FileManager;
use App\Http\Services\UserManager;
use App\User;
use App\UserInfo;
use App\VipRule;
use App\Withdraw;
use Illuminate\Bus\Dispatcher;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class OtherController extends Controller
{
    public function getBannerList(Request $request){
        $allBanner = Banner::orderBy("sort","asc")->orderBy("created_at","desc")->get();
        if(count($allBanner) > 0){
            foreach ($allBanner as $banner){
                /** @var Banner $banner */
                $banner->img_url = FileManager::getImgUrl($banner->img_id);
            }
        }

        return response()->json(["level"=>"success","message"=>"获取成功","data"=>$allBanner]);
    }
}
